Skip to content

Fix/replace deprecated budget method #1604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

caiquefortunato
Copy link

@caiquefortunato caiquefortunato commented Mar 29, 2025

Description

This PR updates the test test_allocate_budget_to_maximize_response_bad_noise_level by replacing the usage of the deprecated method allocate_budget_to_maximize_response with the recommended optimize_budget method.

This aligns the codebase with the current API and avoids suppressing DeprecationWarnings, as discussed in issue #1598 and the feedback on PR #1603.

Related Issue

Checklist


📚 Documentation preview 📚: https://pymc-marketing--1604.org.readthedocs.build/en/1604/

@github-actions github-actions bot added the tests label Mar 29, 2025
Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.40%. Comparing base (a87f1fa) to head (c0e3894).
Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (a87f1fa) and HEAD (c0e3894). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (a87f1fa) HEAD (c0e3894)
23 21
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1604       +/-   ##
===========================================
- Coverage   93.53%   72.40%   -21.13%     
===========================================
  Files          55       55               
  Lines        6357     6357               
===========================================
- Hits         5946     4603     -1343     
- Misses        411     1754     +1343     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@juanitorduz juanitorduz requested a review from cetagostini March 31, 2025 11:35
Copy link
Contributor

@cetagostini cetagostini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @caiquefortunato thank you for the PR. Everything looks good 👍

@cetagostini
Copy link
Contributor

Let's wait for the test to pass before merge but code looks okay!

Copy link
Contributor

@cetagostini cetagostini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I came back from work and see that the current solutions its not enough. Would be great, and we can support you if you need a hand to work on it.


with pytest.raises(ValueError, match="noise_level must be a float"):
mmm_fitted.allocate_budget_to_maximize_response(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, reading this better. Here we are doing the wrong fix. We should:

  1. Replace all the suite (not only this test) to work with the new class.
  2. We need to test the same scenarios, meaning, you need to test optimize budget and sample_response_distribution
  3. No parameters should be delete, the test should be handle differently.
  4. We need test for the method to be deprecated, and the new one. This because we still will hold the old method for at least one more release. So, best way should be to have test for both, and be sure non of them is doing something funny. IF we don't want to do this then we should deprecated already the old method. @williambdean Whats your take?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants